package c.c.a;

import android.content.Context;

public class r1 extends q1 {
    public final g2 d;
    public final c e;

    public r1(Context context, c cVar, g2 g2Var) {
        super(context);
        this.e = cVar;
        this.d = g2Var;
    }

    public boolean a() {
        return true;
    }

    public long b() {
        return this.d.e.getLong("app_log_last_config_time", 0) + 21600000;
    }

    public long[] c() {
        return w1.g;
    }

    /* JADX WARNING: Removed duplicated region for block: B:19:0x0096  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x008f  */
    /* JADX WARNING: Removed duplicated region for block: B:22:0x00a9  */
    public boolean d() {
        /*
        r19 = this;
        r1 = r19;
        r0 = r1.e;
        r0 = r0.a();
        r2 = r1.e;
        r2 = r2.j();
        r3 = 0;
        if (r2 == 0) goto L_0x016f;
    L_0x0011:
        if (r0 == 0) goto L_0x016f;
    L_0x0013:
        r2 = r1.d;
        r2 = r2.e;
        r4 = "app_log_last_config_time";
        r5 = 0;
        r7 = r2.getLong(r4, r5);
        r9 = 21600000; // 0x1499700 float:3.7026207E-38 double:1.0671818E-316;
        r7 = r7 + r9;
        r9 = java.lang.System.currentTimeMillis();
        r2 = (r7 > r9 ? 1 : (r7 == r9 ? 0 : -1));
        if (r2 > 0) goto L_0x016f;
    L_0x002b:
        r2 = new org.json.JSONObject;
        r2.<init>();
        r7 = "magic_tag";
        r8 = "ss_app_log";
        r2.put(r7, r8);
        r9 = "header";
        r2.put(r9, r0);
        r9 = java.lang.System.currentTimeMillis();
        r0 = "_gen_time";
        r2.put(r0, r9);
        r0 = r1.a;
        r9 = r1.e;
        r9 = r9.a();
        r10 = c.c.a.q.f;
        r10 = r10.getSettingUri();
        r11 = com.bytedance.embedapplog.AppLog.getIAppParam();
        r12 = 1;
        r0 = c.c.a.r.a(r0, r9, r10, r12, r11);
        r9 = c.c.a.q.e;
        r0 = c.c.a.q.c(r0, r9);
        r2 = r2.toString();
        r2 = com.bytedance.embedapplog.AppLog.toEncryptByte(r2);
        r9 = 0;
        r0 = c.c.a.q.a(r12, r0, r9, r2);
        if (r0 == 0) goto L_0x007b;
    L_0x0071:
        r2 = new org.json.JSONObject;	 Catch:{ JSONException -> 0x0077 }
        r2.<init>(r0);	 Catch:{ JSONException -> 0x0077 }
        goto L_0x007c;
    L_0x0077:
        r0 = move-exception;
        r0.printStackTrace();
    L_0x007b:
        r2 = r9;
    L_0x007c:
        if (r2 == 0) goto L_0x008c;
    L_0x007e:
        r0 = "";
        r0 = r2.optString(r7, r0);
        r0 = r8.equals(r0);
        if (r0 == 0) goto L_0x008c;
    L_0x008a:
        r0 = 1;
        goto L_0x008d;
    L_0x008c:
        r0 = 0;
    L_0x008d:
        if (r0 == 0) goto L_0x0096;
    L_0x008f:
        r0 = "config";
        r0 = r2.optJSONObject(r0);
        goto L_0x0097;
    L_0x0096:
        r0 = r9;
    L_0x0097:
        r2 = com.bytedance.embedapplog.AppLog.getDataObserver();
        r7 = r1.d;
        r7 = r7.g;
        r7 = c.c.a.n0.c(r0, r7);
        r7 = r7 ^ r12;
        r2.onRemoteConfigGet(r7, r0);
        if (r0 == 0) goto L_0x016f;
    L_0x00a9:
        r2 = r1.d;
        java.util.Objects.requireNonNull(r2);
        r7 = c.c.a.m0.b;
        if (r7 == 0) goto L_0x00c6;
    L_0x00b2:
        r7 = "setConfig, ";
        r7 = c.b.a.a.a.g(r7);
        r8 = r0.toString();
        r7.append(r8);
        r7 = r7.toString();
        c.c.a.m0.a(r7, r9);
    L_0x00c6:
        r2.g = r0;
        r7 = java.lang.System.currentTimeMillis();
        r2 = r2.e;
        r2 = r2.edit();
        r9 = "session_interval";
        r10 = r0.optInt(r9, r3);
        r10 = (long) r10;
        r13 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;
        r15 = 604800; // 0x93a80 float:8.47505E-40 double:2.98811E-318;
        r17 = (r10 > r5 ? 1 : (r10 == r5 ? 0 : -1));
        if (r17 <= 0) goto L_0x00ec;
    L_0x00e2:
        r17 = (r10 > r15 ? 1 : (r10 == r15 ? 0 : -1));
        if (r17 > 0) goto L_0x00ec;
    L_0x00e6:
        r10 = r10 * r13;
        r2.putLong(r9, r10);
        goto L_0x00ef;
    L_0x00ec:
        r2.remove(r9);
    L_0x00ef:
        r9 = "batch_event_interval";
        r10 = r0.optInt(r9, r3);
        r10 = (long) r10;
        r17 = (r10 > r5 ? 1 : (r10 == r5 ? 0 : -1));
        if (r17 <= 0) goto L_0x0104;
    L_0x00fa:
        r5 = (r10 > r15 ? 1 : (r10 == r15 ? 0 : -1));
        if (r5 > 0) goto L_0x0104;
    L_0x00fe:
        r10 = r10 * r13;
        r2.putLong(r9, r10);
        goto L_0x0107;
    L_0x0104:
        r2.remove(r9);
    L_0x0107:
        r5 = "send_launch_timely";
        r6 = r0.optInt(r5, r3);
        if (r6 <= 0) goto L_0x0118;
    L_0x010f:
        r9 = (long) r6;
        r11 = (r9 > r15 ? 1 : (r9 == r15 ? 0 : -1));
        if (r11 > 0) goto L_0x0118;
    L_0x0114:
        r2.putInt(r5, r6);
        goto L_0x011b;
    L_0x0118:
        r2.remove(r5);
    L_0x011b:
        r5 = "abtest_fetch_interval";
        r6 = r0.optInt(r5, r3);
        r9 = (long) r6;
        r17 = 20;
        r6 = (r9 > r17 ? 1 : (r9 == r17 ? 0 : -1));
        if (r6 <= 0) goto L_0x0132;
    L_0x0128:
        r6 = (r9 > r15 ? 1 : (r9 == r15 ? 0 : -1));
        if (r6 > 0) goto L_0x0132;
    L_0x012c:
        r9 = r9 * r13;
        r2.putLong(r5, r9);
        goto L_0x0135;
    L_0x0132:
        r2.remove(r5);
    L_0x0135:
        r5 = "bav_log_collect";
        r6 = r0.optBoolean(r5, r12);
        if (r6 == 0) goto L_0x0141;
    L_0x013d:
        r2.putBoolean(r5, r12);
        goto L_0x0144;
    L_0x0141:
        r2.remove(r5);
    L_0x0144:
        c.c.a.m0.a = r6;
        r5 = "bav_ab_config";
        r6 = r0.optBoolean(r5, r3);
        if (r6 == 0) goto L_0x0152;
    L_0x014e:
        r2.putBoolean(r5, r12);
        goto L_0x0155;
    L_0x0152:
        r2.remove(r5);
    L_0x0155:
        r5 = "bav_monitor_rate";
        r0 = r0.optInt(r5, r3);
        if (r0 <= 0) goto L_0x0165;
    L_0x015d:
        r3 = 100;
        if (r0 > r3) goto L_0x0165;
    L_0x0161:
        r2.putInt(r5, r0);
        goto L_0x0168;
    L_0x0165:
        r2.remove(r5);
    L_0x0168:
        r2.putLong(r4, r7);
        r2.apply();
        return r12;
    L_0x016f:
        return r3;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.a.r1.d():boolean");
    }

    public String e() {
        return "c";
    }
}
